/*
 * loadconfig.h
 *
 *  Created on: Sep 1, 2010
 *      Author: o2o
 */

#ifndef CONFIG_H_
#define CONFIG_H_

#include <stdio.h>

#define FILE_CONFIG "conf/serverconfig.properties"
#define MIME_FILE_CONFIG "conf/mimes.properties"

#define HAVE_SERVER_STATUS
#define BATCH_ACCEPT_MECHANISM
#define SBUFFER_MAX_REUSE_SIZE  (10 * 1024 * 1024)

typedef struct _RSPROPS RSPROPS;

struct ServerConf {
	int httpTimeout;
	int httpThreadNum;
	int httpPort;
	int httpPending;
	char *httpWebRoot;	//must be not NULL
	char *httpServerName;
	int cacheSize;
	int cacheLock;
	char *log_level;
	char *log_file;
	int log_maxbytes;
	int log_maxbackup;

	// MIME configuration.
	struct hashtable* httpMimeTypes;
};

typedef struct ServerConf ServerConf;

/* FUNCTION PROTOTYPES*/
ServerConf* allocateConfigProperties();
ServerConf* load_config();
char* getHeaderByMimeType(struct hashtable *htab, char *mtype);

#endif /* CONFIG_H_ */
